/*
 * Copyright (c) [2012] - [2017] Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Red Hat, Inc. - initial API and implementation
 */
package com.codenvy.api.invite;

import com.codenvy.shared.invite.dto.InviteDto;
import com.codenvy.shared.invite.model.Invite;
import org.eclipse.che.dto.server.DtoFactory;

/**
 * Helps to convert objects related to invite to DTOs.
 *
 * @author Sergii Leschenko
 */
public final class DtoConverter {
  private DtoConverter() {}

  public static InviteDto asDto(Invite invite) {
    return DtoFactory.newDto(InviteDto.class)
        .withEmail(invite.getEmail())
        .withDomainId(invite.getDomainId())
        .withInstanceId(invite.getInstanceId())
        .withActions(invite.getActions());
  }
}
